<template>
  <div id="PicDialog">
    <el-dialog title="修改密码" width="500px" :visible.sync="show">
      <vj-form @submit="onSubmit" @close="show=false" hide-reset :style-config="{labelWidth:'160px'}"
               :slot-idx="cfgList.length-2"
               :loading="loading" class="vj-form" :cfg-list="cfgList"
               :form-data.sync="formData">

      </vj-form>
    </el-dialog>
  </div>
</template>
<script lang="ts">
import Vue, {ComponentOptions, VueConstructor} from "vue"
import Component from 'vue-class-component'
import {Mixins} from "vue-property-decorator";
import {FormMixin} from "@/plugins/mixins/form";
import {ActivityFormTB} from "@/config/table";
import {ACTIVITY_FM, ACTIVITY_LINK_FM, CAPITAL_FM, JOB_FM, PIC_FM, PWD_FM, TALENT_FM} from "@/config/form";
import {cloneDeep, formatOptions, hookSubmit, updateCfgOption} from "vijay-util";
import {requestByGet, requestByPost, requestByPut} from "@/utils/request";
import {CommonStore} from "@/store";

@Component
export default class PicDialog extends Mixins(FormMixin) implements ComponentOptions<Vue> {
  name = "PicDialog"
  show = false;
  editId = null;
  cfgList = PWD_FM

  @hookSubmit()
  async onSubmit() {
    const requestFn = this.editId ? requestByPut : requestByPost;
    await requestFn(`qqc/qqcImgdetails/${this.editId ? 'edit' : 'add'}`, {...this.formData, id: this.editId});
    this.$message.success("操作成功！");
    this.show = false;
    this.$emit('refresh')
  }

  open() {
    this.show = true;
    console.log(CommonStore.userInfo.username)
    // this.editId = data.id;

  }

}
</script>

<style scoped lang="scss">
@import "~assets/common.scss";

#PicDialog {
}
</style>
